//
//  MerchantTableViewCell.m
//  UI_HLJ_Frame
//
//  Created by dllo on 15/7/7.
//  Copyright (c) 2015年 毕宏伟. All rights reserved.
//

#import "MerchantTableViewCell.h"


#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation MerchantTableViewCell
- (void)dealloc
{
    [_shopPic release];
    [_name release];
    [_address release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundView = [[UIView alloc] init];
        [self.contentView addSubview:self.backgroundView];
        
        self.shopPic = [[UIImageView alloc] init];
        [self.backgroundView addSubview:self.shopPic];
        
        self.name = [[UILabel alloc] init];
        [self.backgroundView addSubview:self.name];
        
        self.address = [[UILabel alloc] init];
        [self.backgroundView addSubview:self.address];
        self.address.numberOfLines = 0;
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.backgroundView.frame = CGRectMake(0, 0, WIDTH, 100);
    
    self.shopPic.frame = CGRectMake(10, 10, WIDTH / 3.1, 80);
    
    self.name.frame = CGRectMake(WIDTH / 2.7, 15, WIDTH / 1.67, 35);
    
    self.address.frame = CGRectMake(WIDTH / 2.7, 55, WIDTH / 1.67, 40);
    
    // 倒角
    self.shopPic.layer.cornerRadius = 10;
    // 切断
    self.shopPic.clipsToBounds = YES;
    self.name.font = [UIFont systemFontOfSize:20];
    self.address.font = [UIFont systemFontOfSize:16];
//    self.shopPic.backgroundColor = [UIColor redColor];
//    self.name.backgroundColor = [UIColor redColor];
//    self.address.backgroundColor = [UIColor redColor];
}



- (void)awakeFromNib {
    // Initialization code

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
